<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/5
  Time: 11:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<% String path = request.getContextPath(); %>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>
    <style>
    #hideing{
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    position: fixed;
    opacity: 1;
    z-index: 100;
    display: none;
    }
    #hideing #mesg{
    margin: 0;
    padding: 0;
    width: 30%;
    height: 30%;
    position: absolute;
    right: 55%;
    top: 10px;
    z-index: 120;
    border: #3a3a3a 8px solid;
    background-color: #cccccc;
    overflow: auto;
    }
    #hideing #mesg #headers{
    margin: 0;
    padding: 0;
    background-color:#019875;
    height: 50px;
    z-index: 150;
    color: white;
    }
    #hideing #mesg #headers #butt{
    position: relative;
    background-image: url("<%=path%>/static/web/css/img/controls.png");
    width: 30px;
    height: 30px;
    float: right;
    border:#019875 0px solid;
    }
    #hideing #mesg #headers #butt:hover{
    cursor: pointer;
    }
    #hideing #mesg #headers #sub{
    font-size: 25px;

    }
    #hideing #mesg div {
    text-align: center;
    margin-top: 10px;
    padding: 0;
    height: 50px;
    z-index: 150;
    color: #0C0C0C;
    font-size: 20px;
    }
    #hideing #mesg #oks{
    margin-top: 40px;
    }
    #hideing #mesg #oks input:hover{
    cursor: pointer;
    color: #019875;
    }
    </style>
    <div id="hideing">
    <div id="mesg">
    <div id="headers">
    <span id="sub">修改菜单</span>
    <button id="butt"></button>
    </div>
    <div id="likes">
    <span>规模:&nbsp;</span>
    <input type="text" id="scale" value="">
    </div>

    <div id="oks">
    <span style="margin-left: 10px">
    <input type="button" id="buttons" style="font-size: 20px" value="确定">
    </span>
    </div>
    </div>
    </div>
    <script>
    $(function () {
    $("#insert").click(function () {
    $("#hide").css("display","block");
    });
    });
    $(function () {
    $("#but").click(function () {
    $("#hide").css("display","none");
    });
    });
    $(function () {
    $(".allChoose").click(function () {
    $(":checkbox[id='choose']").prop("checked",$(this).prop("checked"));
    });

    });
    $(function () {
    var id = "";
    $(".link-update").click(function () {
    var name = $(this).parent().prev().prev().html();
    $("#setResume").val(name);
    id = $(this).attr("id");
    $("#hideing").css("display","block");
    });
    $("#butt").click(function () {
    $("#hideing").css("display","none");
    });
    $("#buttons").click(function () {
    var range = $("#scale").val();
    if (range==""){
    return false;
    }
    $.get("<%=path%>/manage/scale/update",{range:range,id,id},function () {
    $("#hideing").css("display","none");
    location.reload();
    });
    });
    });
    </script>
    <table class="result-tab" width="100%">
    <tr>
    <th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>
    <th>ID</th>
    <th>添加时间</th>
    <th>操作</th>
    </tr>
    <c:forEach items="${pageInfo.list}" var="scale">

    <tr id="tr${scale.id}">
        <td class="tc"><input name="id[]" value="58" id="choose${scale.id}" type="checkbox"></td>
    <td>${scale.range}</td>
    <td><fmt:formatDate value="${scale.inputTime}" pattern="yyy-MM-dd"/></td>
    <td>
    <a class="link-update" href="#" id="${scale.id}">修改</a>
    <a class="link-del" href="#"  data-id="${scale.id}">删除</a>
    </td>
    </tr>
    </c:forEach>

    </table>
    <div class="list-page">
    ${requestScope.pageInfo.total}条
    ${requestScope.pageInfo.pages}页
    <a href="#" data-pagenum="1">首页 </a>

    <c:if test="${requestScope.pageInfo.pageNum gt 1}">
        <a href="#" data-pagenum="${requestScope.pageInfo.pageNum-1}">上一页</a>
    </c:if>


    <c:forEach begin="1" end="${requestScope.pageInfo.pages}" var="i">

        <a href="#" data-pagenum="${i}"
        <c:if test="${i eq requestScope.pageInfo.pageNum}"> class="current" </c:if>>${i}</a>
    </c:forEach>


    <c:if test="${requestScope.pageInfo.pageNum lt requestScope.pageInfo.pages}">
        <a href="#" data-pagenum="${requestScope.pageInfo.pageNum+1}">下一页</a>
    </c:if>
    <a href="#" data-pagenum="${requestScope.pageInfo.pages}">尾页 </a>
    ${requestScope.pageInfo.pageNum}/${requestScope.pageInfo.pages}页
    </div>

    <script>

    </script>
